# SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia
#
# SPDX-License-Identifier: BSD-3-Clause


def measurementControl(linkMass, linkDimensions):

    print(
        "\n|-----------------------------------------------------------|",
        "\n|          Anthropometric information table links           |",
        "\n|-----------------------------------------------------------|",
        "\n|         Link          |   Mass[Kg]  |    Dimensions[m]    |",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Head                   |",
        str(round(linkMass["Head_mass"], 2)).ljust(11),
        "|",
        "d: ",
        str(round(linkDimensions["Head"]["X"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Neck                   |",
        str(round(linkMass["Neck_mass"], 2)).ljust(11),
        "|",
        "d: ",
        str(round(linkDimensions["Neck"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "l: ",
        str(round(linkDimensions["Neck"]["Z"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Upper Trunk            |",
        str(round(linkMass["UpperTrunk_mass"], 2)).ljust(11),
        "|",
        "x: ",
        str(round(linkDimensions["UpperTrunk"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "y: ",
        str(round(linkDimensions["UpperTrunk"]["Y"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "z: ",
        str(round(linkDimensions["UpperTrunk"]["Z"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Lower Trunk            |",
        str(round(linkMass["LowerTrunk_mass"], 2)).ljust(11),
        "|",
        "x: ",
        str(round(linkDimensions["LowerTrunk"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "y: ",
        str(round(linkDimensions["LowerTrunk"]["Y"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "z: ",
        str(round(linkDimensions["LowerTrunk"]["Z"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Pelvis                 |",
        str(round(linkMass["Pelvis_mass"], 2)).ljust(11),
        "|",
        "x: ",
        str(round(linkDimensions["Pelvis"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "y: ",
        str(round(linkDimensions["Pelvis"]["Y"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "z: ",
        str(round(linkDimensions["Pelvis"]["Z"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Shoulder               |",
        str(round(linkMass["Shoulder_mass"], 2)).ljust(11),
        "|",
        "d: ",
        str(round(linkDimensions["Shoulder"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "l: ",
        str(round(linkDimensions["Shoulder"]["Y"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Upper Arm              |",
        str(round(linkMass["UpperArm_mass"], 2)).ljust(11),
        "|",
        "d: ",
        str(round(linkDimensions["UpperArm"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "l: ",
        str(round(linkDimensions["UpperArm"]["Y"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Fore Arm               |",
        str(round(linkMass["ForeArm_mass"], 2)).ljust(11),
        "|",
        "d: ",
        str(round(linkDimensions["ForeArm"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "l: ",
        str(round(linkDimensions["ForeArm"]["Y"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Hand                   |",
        str(round(linkMass["Hand_mass"], 2)).ljust(11),
        "|",
        "x: ",
        str(round(linkDimensions["Hand"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "y: ",
        str(round(linkDimensions["Hand"]["Y"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "z: ",
        str(round(linkDimensions["Hand"]["Z"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Upper Leg              |",
        str(round(linkMass["UpperLeg_mass"], 2)).ljust(11),
        "|",
        "d: ",
        str(round(linkDimensions["UpperLeg"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "l: ",
        str(round(linkDimensions["UpperLeg"]["Z"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Lower Leg              |",
        str(round(linkMass["LowerLeg_mass"], 2)).ljust(11),
        "|",
        "d: ",
        str(round(linkDimensions["LowerLeg"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "l: ",
        str(round(linkDimensions["LowerLeg"]["Z"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
        "\n|Foot                   |",
        str(round(linkMass["Foot_mass"], 2)).ljust(11),
        "|",
        "x: ",
        str(round(linkDimensions["Foot"]["X"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "y: ",
        str(round(linkDimensions["Foot"]["Y"], 2)).ljust(15),
        "|",
        "\n|                       |",
        "            |",
        "z: ",
        str(round(linkDimensions["Foot"]["Z"], 2)).ljust(15),
        "|",
        "\n|-----------------------|-------------|---------------------|",
    )

